#ifndef CLICKABLE_LABEL_H
#define CLICKABLE_LABEL_H

#include "label.h"

#include <QList>

class ClickableLabel;   // dummy class

class ClickableLabelListener
{
public:
    virtual void OnClick(ClickableLabel* sender) = 0;
};

class ClickableLabel: public Label
{
public:
    ClickableLabel(Widget* _parent, Engine* _engine, QString _text, int _x, int _y, int _w, int _h,
          TextAlignment _textAlignment = Left);
    ~ClickableLabel();

    virtual void Paint(QPainter &widget_painter);

    virtual void AddClickableListener(ClickableLabelListener* cl);

    virtual void OnMouseMoved(QMouseEvent *e, bool onWidget, int x_rel, int y_rel);
    virtual void OnMousePressed(QMouseEvent *e, bool inside, int x_rel, int y_rel);
    virtual void OnMouseReleased(QMouseEvent *e, bool inside, int x_rel, int y_rel);
    virtual void OnMouseClick(QMouseEvent *e, int x_rel, int y_rel);

private:
    QList< ClickableLabelListener* > listeners;
};

#endif // CLICKABLE_LABEL_H
